﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace wcf<Application>
{
    [ServiceContract]
    public interface I<OwnerU>_<TableU>Service
    {
        [OperationContract]
        DataTable SelectAll();

        [OperationContract]
        DataTable Search(string sField, string sCondition, string sValue);

        [OperationContract]
        <OwnerU>_<TableU>Class Select_Record(<OwnerU>_<TableU>Class cls<OwnerU>_<TableU>Para);

        [OperationContract]
        bool Add(<OwnerU>_<TableU>Class cls<OwnerU>_<TableU>);

        [OperationContract]
        bool Update(<OwnerU>_<TableU>Class old<OwnerU>_<TableU>Class, <OwnerU>_<TableU>Class new<OwnerU>_<TableU>Class);

        [OperationContract]
        bool Delete(<OwnerU>_<TableU>Class cls<OwnerU>_<TableU>);
    }

    [DataContract]
    public class <OwnerU>_<TableU>Class
    {
    <If Loop>
        	<IsNotNull>
        private <VBType> m_<FieldU>;
	        <IsNull>
	       <And>
	       <IsNotNullable>
        private <VBType> m_<FieldU>;
	       <IsNull>
	       <And>
	       <IsNullable>
        private Nullable<<VBType>> m_<FieldU>;
    </If Loop>

    <If Loop>
        <IsNotNull>
        [DataMember]
        public <VBType> <FieldU>
        {
           get
           {
               return m_<FieldU>;
           }
           set
           {
               m_<FieldU> = value;
           }
        }

       <IsNull>
       <And>
       <IsNotNullable>
        [DataMember]
        public <VBType> <FieldU>
        {
           get
           {
               return m_<FieldU>;
           }
           set
           {
               m_<FieldU> = value;
           }
        }

       <IsNull>
       <And>
       <IsNullable>
        [DataMember]
        public Nullable<<VBType>> <FieldU>
        {
           get
           {
               return m_<FieldU>;
           }
           set
           {
               m_<FieldU> = value;
           }
        }

    </If Loop>
    }
}
